﻿using System;
using System.Xml.Serialization;
using nRoute.Components;
using nRoute.Utilities;

namespace nRoute.SiteMaps
{
#if (!SILVERLIGHT && !WINRT)
    [Serializable]
#endif
    [XmlRoot(ElementName = "Areas", Namespace = SiteMaps.XMLNAMESPACE)]
    public class AreasCollection
         : KeyedObservableCollection<string, SiteArea>
    {
        public AreasCollection()
            : base(Utilities.Compatability.INVARIANT_IGNORECASE_STRING_COMPARER) { }

#region Overrides

        protected override string GetKeyForItem(SiteArea item)
        {
            Guard.ArgumentNotNull(item, "item");
            return item.Key;
        }

#endregion
         
    }
}
